<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Java EE 6 Examples</title>
    </h:head>
    <h:body>
        <h:form id="form">
            <h:messages />

            <h1>Employees</h1>
            <h:dataTable id="table" value="#{listBean.list}"
                         var="entity">
                <h:column>
                    <h:outputText value="#{entity.id}"/>
                </h:column>
                <h:column>
                    <h:outputText value="#{entity.name}"/>
                </h:column>
                <h:column>
                    <h:panelGrid columns="2">
                        <h:commandLink value="Delete"
                            action="#{listBean.delete(entity)}">
                            <f:ajax render=":form"/>
                        </h:commandLink>
                        <h:commandLink value="Edit"
                            action="#{editBean.edit(entity)}" />
                    </h:panelGrid>
                </h:column>
            </h:dataTable>
            <br />
            <h:commandButton value="New Employee"
                action="#{editBean.create}" />
        </h:form>
    </h:body>
</html>

